import axios from 'axios'
let Ax = axios.create({
  baseURL: 'http://m.3songshu.com/mobile/api',
  timeout: 8000,
  headers: {
    appkey: 'ef1fc57c13007e33',
    appVersion: '3.4.3'
  }
})

Ax.interceptors.request.use(config => {
  return config
}, err => {
  return Promise.reject(err)
})

Ax.interceptors.response.use(response => {
  if (response.data.data) {
    return response.data.data
  }
  return response
}, err => {
  return Promise.reject(err)
})

export default Ax
